﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace RM2012Server.Component
{
    public partial class MyCursor : UserControl
    {
        public MyCursor()
        {
            InitializeComponent();
        }

        [System.Runtime.InteropServices.DllImport("User32.dll")]
        private static extern IntPtr LoadCursorFromFile(String str);

        public static Cursor Create(String fileName)
        {
            IntPtr hCursor = LoadCursorFromFile(fileName);
            if (!IntPtr.Zero.Equals(hCursor))
            {
                return new Cursor(hCursor);
            }
            else
            {
                return System.Windows.Forms.Cursors.Default;
            }
        }
    }
}
